package com.hr.controller;

import com.hr.pojo.Teacher;
import com.hr.pojo.TeacherUser;
import com.hr.service.TeacherServiceMapper;
import com.hr.vo.SysResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@Slf4j
public class TeacherController {
    @Autowired
    private TeacherServiceMapper teacherServiceMapper;
    @GetMapping("/teach/{id}")
    public SysResult getTeacherList(@PathVariable Integer id){
        log.info("------------------getTeacherList: "+id);
        List<Teacher> teacherlist = teacherServiceMapper.getTeacherlist(id);
        return SysResult.success(teacherlist);
    }
    @GetMapping("/icon/{id}")
    public SysResult getTeacherIcon(@PathVariable Integer id){
        List<TeacherUser> teacherIcon = teacherServiceMapper.getTeacherIcon(id);
        return SysResult.success(teacherIcon);
    }

}
